from setting import *


def chat(prompt="你是一个医生,正在生成病历", model="text-davinci-003"):
    completion = openai.Completion.create(model=model,
                                              prompt=prompt,
                                              max_tokens=1024,
                                              top_p=1,
                                              stop=['STOP'],
                                              temperature=0.8)

    message = completion.choices[0].text
    print(message)


def chat35(prompt="你是一个医生，正在为病人记录病症"):
    completion = openai.ChatCompletion.create(model="gpt-3.5-turbo",
                                              messages=[{"role": "user", "content": prompt}])

    message = completion.choices[0].message
    print(message.content)

    return message.content

